package simple.controller;

import annotation.Autowired;
import annotation.Controller;
import annotation.RequestMapping;
import annotation.Security;
import simple.service.SimpleService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author zheng9feng
 * @Description
 * @Date 2020/12/10 20:12
 */
@RequestMapping("/simple")
@Controller
@Security({"user1","user2","user3","user4"})
public class SimpleController {
	
	@Autowired
	private SimpleService simpleService;
	
	@RequestMapping("/handler1")
	public String handler1(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
	                       String message,String username) throws IOException {
		String printMessage = simpleService.printMessage(message);
		httpServletResponse.getWriter().println(printMessage);
		
		return "";
	}
	
	
}
